package com.chenjiajin.controller;

import com.chenjiajin.aop.annotation.MyLog;
import com.chenjiajin.domain.PojoDemo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class AopController {


    @RequestMapping("/aop")
    @MyLog(title = "这是日志的标题")
    public PojoDemo<String> aop(String test, String test2, HttpServletRequest request) {
        // http://localhost:8001/aop
        // http://localhost:8001/aop?test=/d/,f/d,fg/,df,/ghd/fghf/gh/fgj/hfgh/j/gh/sdf/sdf/sd/fsd/fr/sdf/sdf/sd/fsd//tre/y/rty/rt/yrt/y/rty/try/r
        // http://localhost:8001/aop?test=1&test2=2
        System.err.println("这是执行方法");
        return new PojoDemo<>("success");
    }


    @RequestMapping("/aop2")
    public String aop2() {
        // http://localhost:8001/aop2
        System.err.println("这是执行方法2");
        return "success2";
    }


}